<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{:t('会员')}等级设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<style>
	.layui-form-label{width:130px!important}
	#ggtable .layui-input{ display:inline;height:30px}
	#ggtable .layui-btn{ margin-top:-3px;margin-left:1px}
	</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header">
					{if !$info['id']}<i class="fa fa-plus"></i> 添加{:t('会员')}等级{else}<i class="fa fa-pencil"></i> 编辑{:t('会员')}等级{/if}
					<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
				</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form" lay-filter="">
						<input type="hidden" name="info[id]" value="{$info.id}"/>
						<span style="color:#333">基础设置</span><hr/>
						<div class="layui-form-item">
							<label class="layui-form-label">排序</label>
							<div class="layui-input-inline">
								<input type="text" name="info[sort]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.sort}">
							</div>
							<div class="layui-form-mid layui-word-aux">用于升级顺序判断，数字越大等级越高</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">等级名称</label>
							<div class="layui-input-inline">
								<input type="text" name="info[name]" class="layui-input" value="{$info.name}" lay-verify="required" lay-verType="tips">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">等级图标：</label>
							<input type="hidden" name="info[icon]" id="icon" lay-verType="tips" class="layui-input" value="{$info.icon}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this)" upload-input="icon" upload-preview="iconPreview">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：50×50像素</div>
							<div id="iconPreview" style="float:left;padding-top:10px;padding-left:160px;clear: both;">
								<div class="layui-imgbox" style="width:50px;height:50px"><div class="layui-imgbox-img"><img src="{$info.icon}"/></div></div>
							</div>
						</div>
						{if getcustom('plug_sanyang')}
						<div class="layui-form-item">
							<label class="layui-form-label">分组</label>
							<div class="layui-input-inline">
								<select name="info[cid]" lay-verify="required" lay-filter="changeCategory">
									{foreach $catList as $v}
									<option value="{$v.id}" {if $v['id'] == $info['cid']}selected{/if}>{$v.name}</option>
									{/foreach}
								</select>
								<input type="hidden" name="default_cat_id" id="default_cat_id" value="{$default_cat.id}">
							</div>
						</div>
						{/if}
						<div class="layui-form-item" id="discount" {if !$isdefault_cat} style="display: none;" {/if}>
							<label class="layui-form-label">等级折扣</label>
							<div class="layui-input-inline">
								<input type="text" name="info[discount]" class="layui-input" value="{$info['id']?$info['discount']:10}">
							</div>
							<div class="layui-form-mid layui-word-aux">购买商品时打多少折,10表示不打折,9.5表示打九五折</div>
						</div>
						{if getcustom('kecheng_discount')}
						<div class="layui-form-item" id="discount" {if !$isdefault_cat} style="display: none;" {/if}>
							<label class="layui-form-label">知识付费等级折扣</label>
							<div class="layui-input-inline">
								<input type="text" name="info[kecheng_discount]" class="layui-input" value="{$info['id']?$info['kecheng_discount']:10}">
							</div>
							<div class="layui-form-mid layui-word-aux">购买知识付费商品时打多少折,10表示不打折,9.5表示打九五折</div>
						</div>
						{/if}
						{if $info['isdefault'] != 1}
						<div class="layui-form-item" id="discount" {if !$isdefault_cat} style="display: none;" {/if}>
							<label class="layui-form-label">人数限制</label>
							<div class="layui-input-inline">
								<input type="text" name="info[maxnum]" class="layui-input" value="{$info['id']?$info['maxnum']:10}">
							</div>
							<div class="layui-form-mid layui-word-aux">达到人数限制将不可申请和自动升级到该等级,0表示不限制</div>
						</div>

						<span style="color:#333">升级设置</span><hr/>
						<div class="layui-form-item">
							<label class="layui-form-label">是否可申请</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[can_apply]" value="1" title="是" {if $info['can_apply']==1}checked{/if} lay-filter="can_apply">
								<input type="radio" name="info[can_apply]" value="0" title="否" {if $info['can_apply']!=1}checked{/if} lay-filter="can_apply">
							</div>
							<div class="layui-form-mid layui-word-aux">是否可以由用户主动提交申请资料申请成为该级别</div>
						</div>
						<div  id="can_applyset" style="border:0px dashed #f0cccc;padding-top:10px;margin-bottom:20px;{if $info['can_apply']!=1}display:none{/if}">
						<div class="layui-form-item">
							<label class="layui-form-label">申请条件</label>
							<!-- <div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">微信支付金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[apply_wxpaymoney]" class="layui-input" value="{$info.apply_wxpaymoney}">
							</div> -->
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">订单金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[apply_ordermoney]" class="layui-input" value="{$info.apply_ordermoney}">
							</div>
							<div class="layui-form-mid">或</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">充值金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[apply_rechargemoney]" class="layui-input" value="{$info.apply_rechargemoney}">
							</div>
							{if getcustom('levelup_code')}
							<div class="layui-form-mid">或</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">验证码</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[apply_code]" class="layui-input" value="{$info.apply_code}">
							</div>
							{/if}
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">用户申请成为该级别需要满足的条件，不填写则不需要申请条件</div>
						</div>
						<div class="layui-form-item" style="margin-bottom:0">
							<label class="layui-form-label">升级费用</label>
							<div class="layui-input-inline">
								<input type="text" name="info[apply_paymoney]" class="layui-input" value="{$info.apply_paymoney}">
							</div>
							<div class="layui-form-mid ">元</div>
							<div style="float:left;">
								<div class="layui-form-mid">自定义文字</div>
								<div class="layui-input-inline" style="width:100px"><input type="text" name="info[apply_paytxt]" value="{$info.apply_paytxt|default='升级费用'}" class="layui-input"></div>
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">提交申请时需要交升级费,0代表免费申请</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">升级费用分销</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[apply_payfenxiao]" value="1" title="是" {if $info['apply_payfenxiao']==1}checked{/if}>
								<input type="radio" name="info[apply_payfenxiao]" value="0" title="否" {if $info['apply_payfenxiao']!=1}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux">升级费用是否参与分销</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">申请资料需要审核</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[apply_check]" value="1" title="是" {if $info['apply_check']==1}checked{/if}>
								<input type="radio" name="info[apply_check]" value="0" title="否" {if $info['apply_check']!=1}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux">申请资料是否需要后台审核</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">申请资料设置：</label>
							<div class="layui-input-inline" style="width:800px !important">
								<div class="layui-form-item">
									<!-- <label class="layui-form-label" style="width:100px">添加表单项：</label> -->
									<div class="layui-input-inline" style="width:auto;margin-top:5px">
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('input','','',1)"><i class="icon-plus"></i>单行输入</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('textarea','','',1)"><i class="icon-plus"></i>多行输入</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('radio','','',1)"><i class="icon-plus"></i>单项选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('checkbox','','',1)"><i class="icon-plus"></i>多项选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('selector','','',1)"><i class="icon-plus"></i>普通选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('time','','',1)"><i class="icon-plus"></i>时间选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('date','','',1)"><i class="icon-plus"></i>日期选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('region','','',1)"><i class="icon-plus"></i>省市区选择</button>
										<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addelement('upload','','',1)"><i class="icon-plus"></i>上传图片</button>
									</div>
								</div>
								<table class="layui-table" style="width:860px" id="ggtable">
									<thead>
									<tr>
										<th style="width:100px">字段类型</th>
										<th style="width:150px">字段名称</th>
										<th style="width:280px">字段内容</th>
										<th style="width:150px">是否必填</th>
										<th style="width:170px">操作</th>
									</tr>
									</thead>
									<tbody id="datatable">
										
									</tbody>
								</table>
							</div>
						</div>

						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否可自动升级</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[can_up]" value="1" title="是" {if $info['can_up']==1}checked{/if} lay-filter="can_up">
								<input type="radio" name="info[can_up]" value="0" title="否" {if $info['can_up']!=1}checked{/if} lay-filter="can_up">
							</div>
							<div class="layui-form-mid layui-word-aux">开启后则达到设置条件自动升级为该级别</div>
						</div>

						<div id="can_upset" style="border:0px dashed #f0cccc;padding-top:10px;margin-bottom:20px;{if $info['can_up']!=1}display:none{/if}">
						<div class="layui-form-item">
							<label class="layui-form-label">自动升级条件显示</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[up_condition_show]" value="1" title="显示" {if $info['up_condition_show']==1}checked{/if}>
								<input type="radio" name="info[up_condition_show]" value="0" title="隐藏" {if $info['up_condition_show']!=1}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux">控制前端是否显示升级条件</div>
						</div>
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">升级条件</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">微信支付金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_wxpaymoney]" class="layui-input" value="{$info.up_wxpaymoney}">
							</div>
							<div class="layui-form-mid">或</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">订单金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_ordermoney]" class="layui-input" value="{$info.up_ordermoney}">
							</div>
							<div class="layui-form-mid">或</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">充值金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_rechargemoney]" class="layui-input" value="{$info.up_rechargemoney}">
							</div>
							<div class="layui-form-mid">或</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">领取会员卡</div>
							<div class="layui-input-inline" style="width: 100px;margin-left: 5px;">
								<input type="checkbox" name="info[up_getmembercard]" value="1" lay-text="开启|关闭" lay-skin="switch" {if $info['up_getmembercard']==1}checked{/if}>
							</div>
						</div>
						<div class="layui-form-item" style="margin-bottom:5px">
							<div class="layui-input-inline" style="width: 70px;margin-left: 80px;">
								<select name="info[up_fxorder_condition]" lay-verify="required" lay-filter="changeCategory">
									<option value="or" {if $info['up_fxorder_condition'] == 'or'}selected{/if}>或</option>
									<option value="and" {if $info['up_fxorder_condition'] == 'and'}selected{/if}>且</option>
								</select>
							</div>
<!--							<label class="layui-form-label">或</label>-->
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总订单金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxordermoney]" class="layui-input" value="{$info.up_fxordermoney}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxorderlevelnum]" class="layui-input" value="{$info.up_fxorderlevelnum}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxorderlevelid]" class="layui-input" value="{$info.up_fxorderlevelid}">
							</div>
							{if getcustom('commission2scorepercent')}
							<div class="layui-form-mid" style="margin-left:20px">剔除最高的业绩</div>
							<div class="layui-input-inline" style="width:150px">
								<input type="radio" name="info[up_fxordermoney_removemax]" value="0" {if $info['up_fxordermoney_removemax']==0}checked{/if} title="否"/>
								<input type="radio" name="info[up_fxordermoney_removemax]" value="1" {if $info['up_fxordermoney_removemax']==1}checked{/if} title="是"/>
							</div>
							{/if}
							<div class="layui-form-mid layui-word-aux">级数和等级ID：0表示不限制等级</div>
						</div>
						{if getcustom('plug_ttdz')}
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">或</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级小区订单金额满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxordermoney_xiao]" class="layui-input" value="{$info.up_fxordermoney_xiao}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxorderlevelnum_xiao]" class="layui-input" value="{$info.up_fxorderlevelnum_xiao}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxorderlevelid_xiao]" class="layui-input" value="{$info.up_fxorderlevelid_xiao}">
							</div>
							<div class="layui-form-mid">级数和等级ID：0表示不限制等级</div>
						</div>
						{/if}
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">或</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总人数满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdowncount]" class="layui-input" value="{$info.up_fxdowncount}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelnum]" class="layui-input" value="{$info.up_fxdownlevelnum}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelid]" class="layui-input" value="{$info.up_fxdownlevelid}">
							</div>
							<div class="layui-form-mid">且</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总人数满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdowncount2]" class="layui-input" value="{$info.up_fxdowncount2}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelnum2]" class="layui-input" value="{$info.up_fxdownlevelnum2}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelid2]" class="layui-input" value="{$info.up_fxdownlevelid2}">
							</div>
							{if getcustom('level_comwithdraw')}
								<div class="layui-form-mid">且</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总人数满</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdowncount3]" class="layui-input" value="{$info.up_fxdowncount3}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
								<div class="layui-input-inline" style="width:70px">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelnum3]" class="layui-input" value="{$info.up_fxdownlevelnum3}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
								<div class="layui-input-inline" style="width:70px">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelid3]" class="layui-input" value="{$info.up_fxdownlevelid3}">
								</div>
							{/if}
						</div>
						<div class="layui-form-item" style="margin-bottom:5px">
							{if getcustom('up_fxdowncount_and_isor')}
							<label class="layui-form-label">或</label>
							{/if}
							{if !getcustom('up_fxdowncount_and_isor')}
							<label class="layui-form-label">且</label>
							{/if}
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总人数满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdowncount_and]" class="layui-input" value="{$info.up_fxdowncount_and}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelnum_and]" class="layui-input" value="{$info.up_fxdownlevelnum_and}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelid_and]" class="layui-input" value="{$info.up_fxdownlevelid_and}">
							</div>
							<div class="layui-form-mid">且</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级总人数满</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdowncount2_and]" class="layui-input" value="{$info.up_fxdowncount2_and}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelnum2_and]" class="layui-input" value="{$info.up_fxdownlevelnum2_and}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_fxdownlevelid2_and]" class="layui-input" value="{$info.up_fxdownlevelid2_and}">
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">级数：统计到下级多少层级，如3级。</div>
						</div>


						{if getcustom('up_cat_ordermoney')}
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">或</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">购买分类商品（分类ID）</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_catid]" class="layui-input" value="{$info.up_catid}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">单笔订单金额满</div>
							<div class="layui-input-inline" style="width:100px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_cat_ordermoney]" class="layui-input" value="{$info.up_cat_ordermoney}">
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">此分类下商品单笔订单满xx金额升级，分类ID：多个用英文逗号分割</div>
						</div>
						{/if}

						{if getcustom('up_downbuyprocount')}
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">或</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">下级购买数量满</div>
							<div class="layui-input-inline" style="width:100px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_downbuypronum]" class="layui-input" value="{$info.up_downbuypronum}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">商品ID</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_downbuyproid]" class="layui-input" value="{$info.up_downbuyproid}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">级数</div>
							<div class="layui-input-inline" style="width:70px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_downbuyprolvnum]" class="layui-input" value="{$info.up_downbuyprolvnum}">
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">多个商品ID用英文逗号分割</div>
						</div>
						{/if}
						<div class="layui-form-item" style="margin-bottom:5px">
							<label class="layui-form-label">或</label>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">购买商品(商品ID)</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_proid]" class="layui-input" value="{$info.up_proid}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">购买数量</div>
							<div class="layui-input-inline" style="width:100px">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_pronum]" class="layui-input" value="{$info.up_pronum}">
							</div>
							{if getcustom('levelup_pro_extend_time')}
							<div class="layui-form-mid" style="margin-left:20px">重复购买延长等级有效期</div>
							<div class="layui-input-inline" style="width:150px">
								<input type="radio" name="info[up_pro_extend_time]" value="0" {if $info['up_pro_extend_time']==0}checked{/if} title="否"/>
								<input type="radio" name="info[up_pro_extend_time]" value="1" {if $info['up_pro_extend_time']==1}checked{/if} title="是"/>
							</div>
							{/if}
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">商品ID：多个ID用英文逗号分割，对应的购买数量也用英文逗号分割，用法1：多个商品ID多个购买数量表示任一商品购买数量≥对应数量即满足条件，用法2：多个商品ID一个购买数量表示所有商品的购买总量≥数量即满足条件</div>
						</div>
						<div class="layui-form-item" style="margin-bottom:5px">
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">不填写则不能自动升级为该级别；等级ID：0表示不限制等级,多个用英文逗号","分割；每行一个条件</div>
						</div>

						{if getcustom('up_giveparent')}
						<div class="layui-form-item">
							<label class="layui-form-label">升级给上级人数</label>
							<div class="layui-input-inline">
								<input type="text" name="info[up_giveparent_num]" class="layui-input" value="{$info.up_giveparent_num}">
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">指定等级ID</div>
							<div class="layui-input-inline" style="width: 100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[up_giveparent_levelid]" class="layui-input" value="{$info.up_giveparent_levelid}">
							</div>
							<div class="layui-form-mid layui-word-aux">升级到此等级后，他直推的几个人留给他的上级</div>
						</div>
						{/if}
						{if getcustom('up_change_pid')}
						<div class="layui-form-item">
							<label class="layui-form-label">升级后脱离上级</label>
							<div class="layui-input-inline" style="width:150px;">
								<input type="radio" name="info[up_change_pid]" value="1" title="是" {if $info['up_change_pid']==1}checked{/if}>
								<input type="radio" name="info[up_change_pid]" value="0" title="否" {if $info['up_change_pid']!=1}checked{/if}>
								<!--0不变，1脱离，2修改为上级的上级（预留）-->
							</div>
							<div class="layui-form-mid layui-word-aux">升级到此等级后，他的推荐人为空</div>
						</div>
						{/if}

						</div>


					<!--升级送优惠券Start-->
		  			{if getcustom('up_give_coupon')}
					  <div class="layui-form-item">
						  <label class="layui-form-label" style="width:100px">升级获得{:t('优惠券')}：</label>
						  <div class="layui-input-inline" style="width:auto; overflow: hidden;">
							<div class="layui-tab">
							  <ul class="layui-tab-title">
								  <li class="layui-this">商城优惠券</li>
								  <li>餐饮优惠券</li>
							  </ul>
							  <div class="layui-tab-content">
								  <!--商城优惠券Start-->
								  <div class="layui-tab-item layui-show give-coupon-shop">
								  	<table class="layui-table choose-coupon-up" style="width:500px" id="choose-coupon-up">
									  <thead>
									  <tr>
										  <th>ID</th>
										  <th>名称</th>
										  <th>库存</th>
										  <th>获得数量</th>
										  <th>操作</th>
									  </tr>
									  </thead>
									  {if $upcouponList}
									  {foreach $upcouponList as $k=>$item}
									  <tr class="choose-tr-list">
										  <td>{$item.id}</td>
										  <td>{$item.name}</td>
										  <td>{$item.stock}</td>
										  <td>
											  <input type="hidden" name="info[up_give_coupon][ids][]" value="{$item.id}">
											  <input type="text" name="info[up_give_coupon][nums][]" value="{$item.num}" class="layui-input" style="width:70px"/>
										  </td>
										  <td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTrUp(this)">删除</button></td>
									  </tr>
									  {/foreach}
									  {/if}
									  <tr class="choose-tr-add">
										  <td colspan="5" align="center"><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="showChooseCouponUp()">添加</button></td>
									  </tr>
								  	</table>
										  <script>
											  var chooseCouponLayer;
											  function showChooseCouponUp(){
												  chooseCouponLayer = layer.open({type:2,title:'选择{:t(\'优惠券\')}',content:"{:url('Coupon/choosecoupon')}/callback/choosecouponup",area:['1000px','600px'],shadeClose:true});
											  }
											  function choosecouponup(res,args){
												  var detail = res;
												  var chooseClassName = '.choose-coupon-up';
												  layer.close(chooseCouponLayer);
												  var isadd = 0;
												  $(chooseClassName).find('.choose-tr-list').each(function(){
													  var thisfid = $(this).find('td:eq(0)').html();
													  if(thisfid == detail.id){
														  isadd = 1
														  dialog('该项已添加过了');
													  }
												  });
												  if(isadd == 0){
													  var tr = '<tr class="choose-tr-list">' +
															  '<td>'+detail.id+'</td>' +
															  '<td>'+detail.name+'</td>' +
															  '<td>'+detail.stock+'</td>' +
															  '<td><input type="hidden" name="info[up_give_coupon][ids][]" value="'+detail.id+'"><input type="text" name="info[up_give_coupon][nums][]" value="1" class="layui-input" style="width:70px"/></td>' +
															  '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTrUp(this)">删除</button></td>' +
															  '</tr>';
													  $(chooseClassName).find('.choose-tr-add').before(tr);
												  }
											  }
											  function delChooseTrUp(obj){
												  $(obj).closest('.choose-tr-list').remove();
											  }
										  </script>
									  </div>

								  <!--商城优惠券End-->
								  <!--餐饮优惠券Start-->
								  <div class="layui-tab-item give-coupon-restaurant">
									  <table class="layui-table choose-coupon-upr" style="width:500px" id="choose-coupon-upr">
										  <thead>
										  <tr>
											  <th>ID</th>
											  <th>名称</th>
											  <th>库存</th>
											  <th>获得数量</th>
											  <th>操作</th>
										  </tr>
										  </thead>
										  {if $upcouponRList}
										  {foreach $upcouponRList as $k=>$item}
										  <tr class="choose-tr-list">
											  <td>{$item.id}</td>
											  <td>{$item.name}</td>
											  <td>{$item.stock}</td>
											  <td>
												  <input type="hidden" name="info[up_give_restaurant_coupon][ids][]" value="{$item.id}">
												  <input type="text" name="info[up_give_restaurant_coupon][nums][]" value="{$item.num}" class="layui-input" style="width:70px"/>
											  </td>
											  <td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTrUp(this)">删除</button></td>
										  </tr>
										  {/foreach}
										  {/if}
										  <tr class="choose-tr-add">
											  <td colspan="5" align="center"><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="showChooseCouponUpR()">添加</button></td>
										  </tr>
									  </table>
									  <script>
										  var chooseCouponLayer;
										  function showChooseCouponUpR(){
											  chooseCouponLayer = layer.open({type:2,title:'选择{:t(\'优惠券\')}',content:"{:url('RestaurantCoupon/choosecoupon')}/callback/choosecouponupr",area:['1000px','600px'],shadeClose:true});
										  }
										  function choosecouponupr(res,args){
											  var detail = res;
											  var chooseClassName = '.choose-coupon-upr';
											  layer.close(chooseCouponLayer);
											  var isadd = 0;
											  $(chooseClassName).find('.choose-tr-list').each(function(){
												  var thisfid = $(this).find('td:eq(0)').html();
												  if(thisfid == detail.id){
													  isadd = 1
													  dialog('该项已添加过了');
												  }
											  });
											  if(isadd == 0){
												  var tr = '<tr class="choose-tr-list">' +
														  '<td>'+detail.id+'</td>' +
														  '<td>'+detail.name+'</td>' +
														  '<td>'+detail.stock+'</td>' +
														  '<td><input type="hidden" name="info[up_give_restaurant_coupon][ids][]" value="'+detail.id+'"><input type="text" name="info[up_give_restaurant_coupon][nums][]" value="1" class="layui-input" style="width:70px"/></td>' +
														  '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTrUpR(this)">删除</button></td>' +
														  '</tr>';
												  $(chooseClassName).find('.choose-tr-add').before(tr);
											  }
										  }
										  function delChooseTrUpR(obj){
											  $(obj).closest('.choose-tr-list').remove();
										  }
									  </script>
								  </div>
								  <!--餐饮优惠券End-->
							  </div>
							</div>
						  </div>
					  </div>
					{/if}
		  			<!--升级送优惠券End-->
						<div class="layui-form-item">
							<label class="layui-form-label">升级奖励{:t('积分')}</label>
							<div class="layui-input-inline">
								<input type="text" name="info[up_give_score]" class="layui-input" value="{$info.up_give_score}">
							</div>
							<div class="layui-form-mid layui-word-aux">升到此等级，奖励{:t('积分')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">升级奖励{:t('余额')}</label>
							<div class="layui-input-inline">
								<input type="text" name="info[up_give_money]" class="layui-input" value="{$info.up_give_money}">
							</div>
							<div class="layui-form-mid layui-word-aux">升到此等级，奖励{:t('余额')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">升级奖励{:t('佣金')}</label>
							<div class="layui-input-inline">
								<input type="text" name="info[up_give_commission]" class="layui-input" value="{$info.up_give_commission}">
							</div>
							<div class="layui-form-mid layui-word-aux">升到此等级，奖励{:t('佣金')}</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">升级奖励上级{:t('佣金')}</label>
							<div class="layui-input-inline">
								<input type="number" min="0" name="info[up_give_parent_money]" class="layui-input" value="{$info.up_give_parent_money}">
							</div>
							<div class="layui-form-mid layui-word-aux">升到此等级，给推荐人奖励{:t('佣金')}</div>
						</div>
						{if getcustom('up_give_parent_coupon')}
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:100px">升级奖励上级{:t('优惠券')}：</label>
							<div class="layui-input-inline" style="width:auto; overflow: hidden;">
								<table class="layui-table choose-coupon" style="width:500px" id="choose-coupon">
									<thead>
									<tr>
										<th>ID</th>
										<th>名称</th>
										<th>库存</th>
										<th>赠送数量</th>
										<th>操作</th>
									</tr>
									</thead>
									{if $couponList}
									{foreach $couponList as $k=>$ff}
									<tr class="choose-tr-list"><td>{$ff.id}</td><td>{$ff.name}</td><td>{$ff.stock}</td><td><input type="text" name="info[up_give_parent_coupon_nums][]" value="{$up_give_parent_coupon_nums[$k]}" class="layui-input" style="width:70px"/></td><td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTr(this,{$ff.id})">删除</button></td></tr>
									{/foreach}
									{/if}
									<tr class="choose-tr-add">
										<td colspan="5" align="center"><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="showChooseCoupon()">添加</button></td>
									</tr>
								</table>
								<input type="hidden" name="info[up_give_parent_coupon_ids]" value="{$info.up_give_parent_coupon_ids}"/>
							</div>
							<script>
								var chooseCouponLayer;
								function showChooseCoupon(){
									chooseCouponLayer = layer.open({type:2,title:'选择{:t(\'优惠券\')}',content:"{:url('Coupon/choosecoupon')}",area:['1000px','600px'],shadeClose:true});
								}
								function choosecoupon(res){
									var detail = res;
									var chooseClassName = '.choose-coupon';
									layer.close(chooseCouponLayer);
									var objIds = [];
									var isadd = 0;
									$(chooseClassName).find('.choose-tr-list').each(function(){
										var thisfid = $(this).find('td:eq(0)').html();
										if(thisfid == detail.id){
											isadd = 1
											dialog('该项已添加过了');
										}
										objIds.push(thisfid)
									});
									if(isadd == 0){
										objIds.push(detail.id)
										$("input[name='info[up_give_parent_coupon_ids]']").val(objIds.join(','));
										var tr = '<tr class="choose-tr-list"><td>'+detail.id+'</td><td>'+detail.name+'</td><td>'+detail.stock+'</td><td><input type="text" name="info[up_give_parent_coupon_nums][]" value="1" class="layui-input" style="width:70px"/></td><td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delChooseTr(this,'+detail.id+')">删除</button></td></tr>';
										$(chooseClassName).find('.choose-tr-add').before(tr);
									}
								}
								function delChooseTr(obj,fid){
									$(obj).closest('.choose-tr-list').remove();
									var objIds = [];
									$('#choose-coupon').find('.choose-tr-list').each(function(){
										objIds.push($(this).find('td:eq(0)').html())
									})
									console.log(objIds)
									$("input[name='info[up_give_parent_coupon_ids]']").val(objIds.join(','));
								}
							</script>
						</div>
						{/if}

						{if getcustom('buy_selectmember')}
						<div class="layui-form-item">
							<label class="layui-form-label">是否允许下单选择</label>
							<div class="layui-input-inline" style="width:150px;">
								<input type="radio" name="info[can_buyselect]" value="1" title="是" {if $info['can_buyselect']==1}checked{/if}>
								<input type="radio" name="info[can_buyselect]" value="0" title="否" {if $info['can_buyselect']!=1}checked{/if}>
							</div>
							<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">被选奖励(%)</div>
							<div class="layui-input-inline" style="width:100px;">
								<input style="border-radius:0 2px 2px 0" type="text" name="info[buyselect_commission]" class="layui-input" value="{$info.buyselect_commission}">
							</div>
							<div class="layui-form-mid layui-word-aux">开启后用户在商城中下单时可选择该会员</div>
						</div>
						{/if}


						{/if}

						<div id="can_commission" {if !$isdefault_cat} style="display: none;" {/if}>
							<span style="color:#333">分销设置</span><hr/>
							<div class="layui-form-item">
								<label class="layui-form-label">分销权限</label>
								<div class="layui-input-inline" style="width:500px">
									<input type="radio" name="info[can_agent]" value="0" title="无权限" {if $info['can_agent']==0 || $info['can_agent']==''}checked{/if} lay-filter="can_agent">
									<input type="radio" name="info[can_agent]" value="1" title="一级分销" {if $info['can_agent']==1}checked{/if} lay-filter="can_agent">
									<input type="radio" name="info[can_agent]" value="2" title="二级分销" {if $info['can_agent']==2}checked{/if} lay-filter="can_agent">
									<input type="radio" name="info[can_agent]" value="3" title="三级分销" {if $info['can_agent']==3}checked{/if} lay-filter="can_agent">
								</div>
								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">开启则表示该级别的{:t('会员')}有分销权限，可以发展下级，拿相应提成</div>
							</div>
							<div class="layui-form-item" id="can_agentset"  style="border:0px dashed #f0cccc;padding-top:10px;margin-bottom:20px;{if $info['can_agent']==0 || $info['can_agent']==''}display:none{/if}">
								<div class="layui-form-item">
									<label class="layui-form-label">提成方式</label>
									<div class="layui-input-inline" style="width:250px">
										<input type="radio" name="info[commissiontype]" value="0" title="百分比" {if $info['commissiontype']==0}checked{/if}  lay-filter="commissiontype">
										<input type="radio" name="info[commissiontype]" value="1" title="固定金额" {if $info['commissiontype']==1}checked{/if}  lay-filter="commissiontype">
									</div>
									<div class="layui-form-mid layui-word-aux">设置固定金额时按单返{:t('佣金')},和购买数量无关</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">提成金额</label>
									<div class="layui-form-mid" commission1 style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">一级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>) </div>
									<div class="layui-input-inline" commission1 style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission1]" class="layui-input" value="{$info.commission1}">
									</div>
									<div class="layui-form-mid" commission2 style="{if $info['can_agent']<2}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">二级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" commission2 style="{if $info['can_agent']<2}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission2]" class="layui-input" value="{$info.commission2}">
									</div>
									<div class="layui-form-mid" commission3 style="{if $info['can_agent']<3}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">三级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" commission3 style="{if $info['can_agent']<3}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission3]" class="layui-input" value="{$info.commission3}">
									</div>
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">持续推荐奖励(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission_parent]" class="layui-input" value="{$info.commission_parent}">
									</div>
									{if getcustom('commission_parent_pj')}
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">平级奖(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission_parent_pj]" class="layui-input" value="{$info.commission_parent_pj}">
									</div>
									{/if}
									{if getcustom('commission_appointlevelid')}
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">指定等级ID</div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission_appointlevelid]" class="layui-input" value="{$info.commission_appointlevelid}">
									</div>
									{/if}
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">用户直接推荐的是一级，用户的下级推荐的是二级，用户的下级的下级推荐的是三级<br>
									持续推荐奖励：当一二三级获得提成时，一二三级的直属上级（分销商身份）可获得下级提成金额的百分比或固定金额作为奖励，由平台发放（限商城订单）<br>
										* 当商家开启独立收款并且开启商家返款扣除分销佣金时，提成金额比例+平台抽成金额比例不能超过30%（微信支付分账限制）
									</div>
								</div>
								{if getcustom('plug_ttdz')}
								<div class="layui-form-item">
									<label class="layui-form-label">复购提成</label>
									<div class="layui-form-mid" commission1 style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 一级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>) </div>
									<div class="layui-input-inline" commission1 style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission4]" class="layui-input" value="{$info.commission4}">
									</div>
									<div class="layui-form-mid" commission2 style="{if $info['can_agent']<2}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">二级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" commission2 style="{if $info['can_agent']<2}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission5]" class="layui-input" value="{$info.commission5}">
									</div>
									<div class="layui-form-mid" commission3 style="{if $info['can_agent']<3}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">三级(<span class="commissionunit">{$info['commissiontype']==1 ? '元':'%'}</span>)</div>
									<div class="layui-input-inline" commission3 style="{if $info['can_agent']<3}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[commission6]" class="layui-input" value="{$info.commission6}">
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px"></div>
								</div>
								{/if}

								<div class="layui-form-item">
									<label class="layui-form-label">推荐{:t('积分')}</label>
									<div class="layui-form-mid" commission1 style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 一级({:t('积分')}) </div>
									<div class="layui-input-inline" commission1 style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[score1]" class="layui-input" value="{$info.score1|default=0}">
									</div>
									<div class="layui-form-mid" commission2 style="{if $info['can_agent']<2}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">二级({:t('积分')})</div>
									<div class="layui-input-inline" commission2 style="{if $info['can_agent']<2}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[score2]" class="layui-input" value="{$info.score2|default=0}">
									</div>
									<div class="layui-form-mid" commission3 style="{if $info['can_agent']<3}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">三级({:t('积分')})</div>
									<div class="layui-input-inline" commission3 style="{if $info['can_agent']<3}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[score3]" class="layui-input" value="{$info.score3|default=0}">
									</div>
									<div class="layui-form-mid" commission1 style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">最高限制({:t('积分')})</div>
									<div class="layui-input-inline" commission1 style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[scoremax]" class="layui-input" value="{$info.scoremax|default=0}">
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">每推荐一个人奖励多少{:t('积分')}；最高限制指每个人通过推荐获得最高积分数，高于此设置将不再获得推荐积分，0表示不限制</div>
								</div>
								{if getcustom('maidan_commission_score')}
								<div class="layui-form-item">
									<label class="layui-form-label">买单提成{:t('积分')}</label>
									<div class="layui-form-mid" commission1 style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">一级(%) </div>
									<div class="layui-input-inline" commission1 style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_commission_score1]" class="layui-input" value="{$info.maidan_commission_score1|default=0}">
									</div>
									<div class="layui-form-mid" commission2 style="{if $info['can_agent']<2}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">二级(%)</div>
									<div class="layui-input-inline" commission2 style="{if $info['can_agent']<2}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_commission_score2]" class="layui-input" value="{$info.maidan_commission_score2|default=0}">
									</div>
									<div class="layui-form-mid" commission3 style="{if $info['can_agent']<3}display:none;{/if}margin-right:0;background:#e6e6e6;padding: 9px 9px !important">三级(%)</div>
									<div class="layui-input-inline" commission3 style="{if $info['can_agent']<3}display:none;{/if}width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_commission_score3]" class="layui-input" value="{$info.maidan_commission_score3|default=0}">
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">买单成功后奖励{:t('积分')}，奖励积分后，不再计算提成金额；0表示不赠送</div>
								</div>
								{/if}
								<div class="layui-form-item">
									<label class="layui-form-label">推荐规则</label>
									<div class="layui-input-inline" style="width:800px">
										<input type="radio" name="info[agent_rule]" value="0" title="初次进入即绑定推荐关系" {if $info['agent_rule']==0 || $info['agent_rule']==''}checked{/if}>
										<input type="radio" name="info[agent_rule]" value="1" title="有推荐人时绑定推荐关系" {if $info['agent_rule']==1}checked{/if}>
										<input type="radio" name="info[agent_rule]" value="2" title="不绑定推荐关系" {if $info['agent_rule']==2}checked{/if}>
										<input type="radio" name="info[agent_rule]" value="3" title="首次消费后绑定推荐关系" {if $info['agent_rule']==3}checked{/if}>
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">初次进入即绑定推荐关：只有没有进入过平台的新{:t('会员')}才能被推荐，并且初次进入就确定了推荐人，终身绑定，不会再被其他人推荐；<br/>有推荐人时绑定推荐关系：没有推荐人时可以被推荐，一旦有了推荐人，该{:t('会员')}的推荐人就确定了，不会再被其他人推荐；<br/>不绑定推荐关系：即使该{:t('会员')}有推荐人，当被另一个人推荐时，TA的推荐人就会变成后来推荐TA的人。<br/>首次消费后绑定推荐关系：即{:t('会员')}在未消费前，当被另一个人推荐时，TA的推荐人就会变成后来推荐TA的人。</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">自己拿一级提成</label>
									<div class="layui-input-inline" style="width:500px">
										<input type="radio" name="info[commission1own]" value="0" title="否" {if $info['commission1own']==0 || $info['commission1own']==''}checked{/if}>
										<input type="radio" name="info[commission1own]" value="1" title="是" {if $info['commission1own']==1}checked{/if}>
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">开启则表示一级为自己，即自己购买商品自己拿一级{:t('佣金')}</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">我的团队权限</label>
									<div class="layui-input-inline" style="width:600px">
										<input type="checkbox" name="info[team_showtel]" value="1" {if $info['team_showtel']==1}checked{/if} title="查看下级手机号" lay-skin="primary">
										<input type="checkbox" name="info[team_givemoney]" value="1" {if $info['team_givemoney']==1}checked{/if} title="给下级转余额" lay-skin="primary">
										<input type="checkbox" name="info[team_givescore]" value="1" {if $info['team_givescore']==1}checked{/if} title="给下级转积分" lay-skin="primary">
										{if getcustom('plug_zhiming')}
										<input type="checkbox" name="info[team_levelup]" value="1" {if $info['team_levelup']==1}checked{/if} title="给下级升级" lay-skin="primary" lay-filter="team_levelup">
										{/if}
									</div>
								</div>
								<div class="layui-form-item team_levelup_div" style="{if $info['team_levelup']!=1} display:none {/if}">
									<label class="layui-form-label">给下级升级设置</label>
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[team_levelup_id]" class="layui-input" value="{$info.team_levelup_id}">
									</div>
									<div class="layui-form-mid"></div>
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">数量</div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[team_levelup_num]" class="layui-input" value="{$info.team_levelup_num}">
									</div>
									<div class="layui-form-mid layui-word-aux">可以给下级升级的等级和数量</div>
								</div>
								{if getcustom('plug_huangfeihong')}
								<div class="layui-form-item">
									<label class="layui-form-label">业绩统计</label>
									<div class="layui-input-inline" style="width:500px">
										<input type="radio" name="info[tongji_yeji]" value="0" title="否" {if $info['tongji_yeji']==0 || $info['tongji_yeji']==''}checked{/if}>
										<input type="radio" name="info[tongji_yeji]" value="1" title="是" {if $info['tongji_yeji']==1}checked{/if}>
									</div>
									<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">开启后统计自己和所有下级的指定商品购买数量</div>
								</div>
								<div class="layui-form-item">
									<label class="layui-form-label">业绩统计商品ID</label>
									<div class="layui-input-inline">
										<input type="text" name="info[tongji_yeji_proids]" class="layui-input" value="{$info.tongji_yeji_proids}">
									</div>
									<div class="layui-form-mid layui-word-aux">商品ID多个使用英文逗号“,”分隔，不指定则统计所有购买商品</div>
								</div>
								{/if}

								{if getcustom('commission_givedown')}
								<div class="layui-form-item">
									<label class="layui-form-label">千里马奖：</label>
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 提成比例(%) </div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[givedown_percent]" class="layui-input" value="{$info.givedown_percent|default=0}">
									</div>
									<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 提成金额(元) </div>
									<div class="layui-input-inline" style="width: 100px;">
										<input style="border-radius:0 2px 2px 0" type="text" name="info[givedown_commission]" class="layui-input" value="{$info.givedown_commission|default=0}">
									</div>
									<div class="layui-form-mid">自定义名称</div>
									<div class="layui-input-inline" style="width:170px">
										<input type="text" name="info[givedown_txt]" class="layui-input" value="{$info.givedown_txt|default='千里马奖'}">
									</div>
									<div class="layui-form-mid layui-word-aux">拿出佣金的一部分比例给下级平分</div>
								</div>
								{/if}
								{if getcustom('maidan_qrcode')}
									<div class="layui-form-item" >
										<label class="layui-form-label">买单分成</label>
										<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">直推人扫码分成(%) </div>
										<div class="layui-input-inline" style="width: 100px;">
											<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_zt_ratio]" class="layui-input" value="{$info.maidan_zt_ratio|default=0}">
										</div>
										<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 直推人间接消费分成(%) </div>
										<div class="layui-input-inline" style="width: 100px;">
											<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_zt_payother_ratio]" class="layui-input" value="{$info.maidan_zt_payother_ratio|default=0}">
										</div>
										<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important"> 非直推人收款分成(%) </div>
										<div class="layui-input-inline" style="width: 100px;">
											<input style="border-radius:0 2px 2px 0" type="text" name="info[maidan_nzt_payself_ratio]" class="layui-input" value="{$info.maidan_nzt_payself_ratio|default=0}">
										</div>
									</div>
								{/if}
								{if getcustom('business_agent')}
									<div class="layui-form-item" >
										<label class="layui-form-label">商家分成</label>
										<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">直推分成(%) </div>
										<div class="layui-input-inline" style="width: 100px;">
											<input style="border-radius:0 2px 2px 0" type="text" name="info[business_zt_ratio]" class="layui-input" value="{$info.business_zt_ratio|default=0}">
										</div>
										<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">间推分成(%) </div>
										<div class="layui-input-inline" style="width: 100px;">
											<input style="border-radius:0 2px 2px 0" type="text" name="info[business_jt_ratio]" class="layui-input" value="{$info.business_jt_ratio|default=0}">
										</div>
									</div>
								{/if}
							</div>
						</div>

						{if $auth_data=='all' || in_array('gdfenhong',$auth_data) || in_array('teamfenhong',$auth_data) || in_array('areafenhong',$auth_data)}
						<span style="color:#333">分红设置</span><hr/>
						{/if}
						{if $auth_data=='all' || in_array('teamfenhong',$auth_data)}
							<div class="layui-form-item">
								<label class="layui-form-label">团队分红</label>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红级数</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhonglv]" class="layui-input" value="{$info.teamfenhonglv|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红比例(%)</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhongbl]" class="layui-input" value="{$info.teamfenhongbl|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每单分红金额</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhong_money]" class="layui-input" value="{$info.teamfenhong_money|default=0}">
								</div>
								<div class="layui-form-mid">只给最近的上级分红</div>
								<div class="layui-input-inline" style="width: 80px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[teamfenhongonly]" value="1" {if $info['teamfenhongonly']==1}checked{/if} title="只返最近的上级" lay-skin="primary">
								</div>
								<div class="layui-form-mid">包含自己</div>
								<div class="layui-input-inline" style="width: 70px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[teamfenhong_self]" value="1" {if $info['teamfenhong_self']==1}checked{/if} title="包含自己" lay-skin="primary">
								</div>
								{if getcustom('teamfenhong_removemax')}
								<div class="layui-form-mid">去掉最高</div>
								<div class="layui-input-inline" style="width: 70px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[teamfenhong_removemax]" value="1" {if $info['teamfenhong_removemax']==1}checked{/if} lay-skin="primary">
								</div>
								{/if}
								{if getcustom('fenhong_removefenxiao')}
								<div class="layui-form-mid">扣除分销佣金</div>
								<div class="layui-input-inline" style="width: 70px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[teamfenhong_removefenxiao]" value="1" {if $info['teamfenhong_removefenxiao']==1}checked{/if} lay-skin="primary">
								</div>
								{/if}
								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">设置分红级数和分红比例后该等级的人可以拿到其下[分红级数]级所有{:t('会员')}的所有商城订单的分红提成比例+每单分红金额；<br>开启只给最近的上级分红表示如果下单人有多个上级均符合分红条件则只给离他最近的上级分红，其他上级不分红</div>
							</div>
							{if $teamfenhong_pingji}
							<div class="layui-form-item">
								<label class="layui-form-label">团队分红平级奖</label>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红级数</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhong_pingji_lv]" class="layui-input" value="{$info.teamfenhong_pingji_lv|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">奖励比例(%)</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhong_pingji_bl]" class="layui-input" value="{$info.teamfenhong_pingji_bl|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每单奖励金额</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[teamfenhong_pingji_money]" class="layui-input" value="{$info.teamfenhong_pingji_money|default=0}">
								</div>
								<input type="radio" name="info[teamfenhong_pingji_type]" value="0" title="按奖励金额" {if $info['teamfenhong_pingji_type']==0}checked{/if}>
								<input type="radio" name="info[teamfenhong_pingji_type]" value="1" title="按订单金额" {if $info['teamfenhong_pingji_type']==1}checked{/if}>
								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">如果下级有团队分红并且下级等级和自己等级相同则拿下级团队分红金额的奖励比例+每单奖励金额，只给最近的上级<br>按奖励金额表示拿下级团队分红金额的比例,按订单金额表示拿订单金额的比例</div>
							</div>
							{/if}
							{if getcustom('product_teamfenhong')}
							<div class="layui-form-item">
								<label class="layui-form-label">商品团队分红</label>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红商品ID</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[product_teamfenhong_ids]" class="layui-input" value="{$info.product_teamfenhong_ids|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红级数</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[product_teamfenhonglv]" class="layui-input" value="{$info.product_teamfenhonglv|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每个商品分红金额</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[product_teamfenhong_money]" class="layui-input" value="{$info.product_teamfenhong_money|default=0}">
								</div>
								<div class="layui-form-mid">只给最近的上级分红</div>
								<div class="layui-input-inline" style="width: 80px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[product_teamfenhongonly]" value="1" {if $info['product_teamfenhongonly']==1}checked{/if} title="只返最近的上级" lay-skin="primary">
								</div>
								<div class="layui-form-mid">包含自己</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[product_teamfenhong_self]" value="1" {if $info['product_teamfenhong_self']==1}checked{/if} title="包含自己" lay-skin="primary">
								</div>

								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">设置分红级数和分红金额后该等级的人可以拿到其下[分红级数]级所有{:t('会员')}的所有商城订单中购买分红商品数量*分红金额；<br>分红商品ID为0时表示不限制商品，多个商品ID用英文逗号分割</div>
							</div>
							{/if}
							{if getcustom('level_teamfenhong')}
							<div class="layui-form-item">
								<label class="layui-form-label">等级团队分红</label>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">等级ID</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[level_teamfenhong_ids]" class="layui-input" value="{$info.level_teamfenhong_ids}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红级数</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[level_teamfenhonglv]" class="layui-input" value="{$info.level_teamfenhonglv|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红比例(%)</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[level_teamfenhongbl]" class="layui-input" value="{$info.level_teamfenhongbl|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每单分红金额</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[level_teamfenhong_money]" class="layui-input" value="{$info.level_teamfenhong_money|default=0}">
								</div>
								<div class="layui-form-mid">只给最近的上级分红</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[level_teamfenhongonly]" value="1" {if $info['level_teamfenhongonly']==1}checked{/if} title="只返最近的上级" lay-skin="primary">
								</div>

								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">等级ID：多个用英文逗号“,”分割；设置等级ID、分红级数和分红比例后伞下该等级的人可以拿到其下等级ID下[分红级数]所有{:t('会员')}的所有商城订单的分红提成比例+每单分红金额；<br>开启只给最近的上级分红表示如果下单人有多个上级均符合分红条件则只给离他最近的上级分红，其他上级不分红</div>
							</div>
							{/if}
						{/if}
						{if $auth_data=='all' || in_array('gdfenhong',$auth_data)}
							<div class="layui-form-item">
								<label class="layui-form-label">股东分红</label>
								<div class="layui-input-inline" style="width:120px">
									<input type="text" name="info[fenhong]" class="layui-input" value="{$info['id']?$info['fenhong']:0}">
								</div>
								<div class="layui-form-mid">%</div>
								{if getcustom('level_comwithdraw')}
								<div class="layui-form-mid" style="margin-left:20px;margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红限制人数</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[fenhong_num]" class="layui-input" value="{$info.fenhong_num|default=0}">
								</div>
								{/if}
								{if getcustom('plug_sanyang') || getcustom('everyday_hongbao') || getcustom('fenhong_max')}
								<div class="layui-form-mid" style="margin-left:20px;margin-right:0;background:#e6e6e6;padding: 9px 9px !important">每人分红金额上限</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="number" min="0" name="info[fenhong_max_money]" class="layui-input" value="{$info.fenhong_max_money|default=0}">
								</div>
								{/if}
								{if $sysset['partner_gongxian']==1}
								<div class="layui-form-mid" style="margin-left:20px;margin-right:0;background:#e6e6e6;padding: 9px 9px !important">团队业绩达</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="number" min="0" name="info[fenhong_gongxian_minyeji]" class="layui-input" value="{$info.fenhong_gongxian_minyeji}">
								</div>
								<div class="layui-form-mid" style="margin-left:20px;margin-right:0;background:#e6e6e6;padding: 9px 9px !important">贡献分红比例(%)</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="number" min="0" name="info[fenhong_gongxian_percent]" class="layui-input" value="{$info.fenhong_gongxian_percent}">
								</div>
								{/if}
								
								{if getcustom('fenhong_removefenxiao')}
								<div class="layui-form-mid">扣除分销佣金</div>
								<div class="layui-input-inline" style="width: 70px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[gdfenhong_removefenxiao]" value="1" {if $info['gdfenhong_removefenxiao']==1}checked{/if} lay-skin="primary">
								</div>
								{/if}
								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">用于合伙人或股东分红，设置分红比例后该等级的所有人平均分摊所有商城订单的分红提成比例{if getcustom('plug_sanyang')}，分红上限为0则不限制{/if}</div>
							</div>
						{/if}
						{if $auth_data=='all' || in_array('areafenhong',$auth_data)}
							<div class="layui-form-item">
								<label class="layui-form-label">区域代理</label>
								<div class="layui-input-inline" style="width:350px;">
									<input type="radio" name="info[areafenhong]" value="0" title="关闭" {if $info['areafenhong']==0}checked{/if}>
									{if getcustom('areafenhong_jiaquan') && ($auth_data=='all' || in_array('Largearea/*',$auth_data))}
									<input type="radio" name="info[areafenhong]" value="10" title="大区" {if $info['areafenhong']==10}checked{/if}>
									{/if}
									<input type="radio" name="info[areafenhong]" value="1" title="省级" {if $info['areafenhong']==1}checked{/if}>
									<input type="radio" name="info[areafenhong]" value="2" title="市级" {if $info['areafenhong']==2}checked{/if}>
									<input type="radio" name="info[areafenhong]" value="3" title="区县" {if $info['areafenhong']==3}checked{/if}>
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">分红比例(%)</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[areafenhongbl]" class="layui-input" value="{$info.areafenhongbl|default=0}">
								</div>
								<div class="layui-form-mid" style="margin-right:0;background:#e6e6e6;padding: 9px 9px !important">人数限制</div>
								<div class="layui-input-inline" style="width: 100px;">
									<input style="border-radius:0 2px 2px 0" type="text" name="info[areafenhongmaxnum]" class="layui-input" value="{$info.areafenhongmaxnum|default=0}">
								</div>
								{if getcustom('fenhong_removefenxiao')}
								<div class="layui-form-mid">扣除分销佣金</div>
								<div class="layui-input-inline" style="width: 70px;">
									<input type="checkbox" lay-skin="switch" lay-text="开启|关闭" name="info[areafenhong_removefenxiao]" value="1" {if $info['areafenhong_removefenxiao']==1}checked{/if} lay-skin="primary">
								</div>
								{/if}
								<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">开启区域代理后需要开启用户申请升级，用户填写申请资料时选择要申请的代理区域<br>设置分红比例后该等级的同一个代理区域的人平均分摊所有商城内该区域的订单的分红提成比例，人数限制表示每个区域最多可以有多少区域代理 0表示不限制</div>
							</div>
						{/if}
						<span style="color:#333">其他设置</span><hr/>
						{if $info['isdefault'] != 1}
						<div class="layui-form-item">
							<label class="layui-form-label">等级有效期</label>
							<div class="layui-input-inline">
								<input type="text" name="info[yxqdate]" class="layui-input" value="{$info.yxqdate}" lay-verify="required" lay-verType="tips">
							</div>
							<div class="layui-form-mid">天</div>
							<div class="layui-form-mid layui-word-aux">升级成为该等级后多少天自动变回默认等级，0表示长期</div>
						</div>
						{/if}
						{if getcustom('next_level_set')}
						<div class="layui-form-item">
							<label class="layui-form-label">到期等级</label>
							<div class="layui-input-inline">
								<span id="next_level_name" style="line-height: 40px;background: #eb8025;padding: 3px 6px;color: #fff;">{$info.next_level_name|default="默认等级"}</span>
								<input type="hidden" id="next_level_id" name="info[next_level_id]" class="layui-input" value="{$info.next_level_id}">
							</div>
							<div class="layui-input-inline">
								<button class="layui-btn layui-btn-primary" onclick="showChooseLevel()">选择等级</button>
							</div>
							<div class="layui-form-mid layui-word-aux">该等级到期后，指定下个等级，如果不指定，即回到默认等级</div>
						</div>
						<script>
							var chooseLevelLayer;
							function showChooseLevel(){
								chooseLevelLayer = layer.open({type:2,title:'选择{:t(\'等级\')}',content:"{:url('MemberLevel/chooselevel')}",area:['1000px','600px'],shadeClose:true});
							}
							function chooselevel(res,args){
								$('#next_level_name').html(res.name)
								$('#next_level_id').val(res.id)
							}
						</script>
						{/if}
						{if $plug_businessqr}
						<div class="layui-form-item">
							<label class="layui-form-label">是否显示在商家</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="radio" name="info[show_business]" value="0" title="否" {if $info['show_business']==0 || $info['show_business']==''}checked{/if}>
								<input type="radio" name="info[show_business]" value="1" title="是" {if $info['show_business']==1}checked{/if}>
							</div>
							<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:160px">关闭后商家编辑商品等不显示此等级</div>
						</div>
						{/if}
						{if getcustom('level_comwithdraw')}
						<div class="layui-form-item">
							<label class="layui-form-label">佣金提现</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="radio" name="info[comwithdraw]" value="1" title="开启" {if !$info['id'] || $info['comwithdraw']==1}checked{/if}>
								<input type="radio" name="info[comwithdraw]" value="0" title="关闭" {if $info['id'] && $info['comwithdraw']==0}checked{/if}>
							</div>
						</div>
						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label">特权说明</label>
							<div class="layui-input-inline" style="width:500px">
								<script id="explain" name="info[explain]" type="text/plain" style="width:100%;height:400px">{$info.explain}</script>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
	{include file="public/js"/}
	<script>
	var ueditor = UE.getEditor('explain',{imageScaleEnabled:false});

	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		//return;
		field['info[explain]'] = ueditor.getContent();
		if(!field['info[up_getmembercard]']) field['info[up_getmembercard]'] = 0
		if(!field['info[team_showtel]']) field['info[team_showtel]'] = 0
		if(!field['info[team_givemoney]']) field['info[team_givemoney]'] = 0
		if(!field['info[team_givescore]']) field['info[team_givescore]'] = 0
		if(!field['info[team_levelup]']) field['info[team_levelup]'] = 0
		if(!field['info[teamfenhongonly]']) field['info[teamfenhongonly]'] = 0
		if(!field['info[level_teamfenhongonly]']) field['info[level_teamfenhongonly]'] = 0
		if(!field['info[teamfenhong_self]']) field['info[teamfenhong_self]'] = 0
		if(!field['info[product_teamfenhong_self]']) field['info[product_teamfenhong_self]'] = 0
		if(!field['info[teamfenhong_removemax]']) field['info[teamfenhong_removemax]'] = 0
		{if getcustom('fenhong_removefenxiao')}
		if(!field['info[teamfenhong_removefenxiao]']) field['info[teamfenhong_removefenxiao]'] = 0
		if(!field['info[gdfenhong_removefenxiao]']) field['info[gdfenhong_removefenxiao]'] = 0
		if(!field['info[areafenhong_removefenxiao]']) field['info[areafenhong_removefenxiao]'] = 0
		{/if}
		var index = layer.load();
	  // console.log(obj)
	  //return;
		$.post("{:url('save')}",obj.field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				setTimeout(function(){
					parent.layer.closeAll();
					parent.tableIns.reload()
				},1000)
			}
		})
	})

	layui.form.on('select(changeCategory)', function(data){
		var default_cat_id = $("#default_cat_id").val();
		if(data.value == default_cat_id){
			$('#can_commission').show();
			$('#discount').show();
		}else{
			$('#can_commission').hide();
			$('#discount').hide();
		}
	})
	layui.form.on('radio(can_apply)', function(data){
		if(data.value == '1'){
			$('#can_applyset').show();
		}else{
			$('#can_applyset').hide();
		}
	})
	layui.form.on('radio(can_agent)', function(data){
		if(data.value != '0'){
			if(data.value=='1'){
				$('*[commission2]').hide();
				$('[commission3]').hide();
			}else if(data.value=='2'){
				$('*[commission2]').show();
				$('[commission3]').hide();
			}else if(data.value=='3'){
				$('*[commission2]').show();
				$('[commission3]').show();
			}
			$('#can_agentset').show();
		}else{
			$('#can_agentset').hide();
		}
	})
	layui.form.on('radio(can_up)', function(data){
		if(data.value == '1'){
			$('#can_upset').show();
		}else{
			$('#can_upset').hide();
		}
	})
	layui.form.on('radio(commissiontype)', function(data){
		if(data.value == '1'){
			$('.commissionunit').html('元');
		}else{
			$('.commissionunit').html('%');
		}
	})
	layui.form.on('checkbox(team_levelup)', function(data){
		// console.log(data.elem.checked );
		if(data.elem.checked){
			$('.team_levelup_div').show();
		}else{
			$('.team_levelup_div').hide();
		}
	})

	var dhdata = {$info['apply_formdata']};
	$(function(){
		for(var i=0;i<dhdata.length;i++){
			addelement(dhdata[i].key,dhdata[i].val1,dhdata[i].val2,dhdata[i].val3)
		}
	});
	function toup(obj){
		var onthis=$(obj).parent().parent();  
		var getUp=onthis.prev();
		if (getUp.length<=0)  {
			layer.msg("到顶了");  
			return;  
		}  
		onthis.after(getUp);  
	}
	function todown(obj){
		var onthis=$(obj).parent().parent();  
		var getdown=onthis.next();
		if (getdown.length<=0){  
			layer.msg("到底了");  
			return;  
		}
		getdown.after(onthis);
	}

	var ekey = 0;
	//添加元素
	function addelement(type,val1,val2,val3){
		if(type=='input'){
			var name = '单行输入';
		}else if(type=='textarea'){
			var name = '多行输入';
		}else if(type=='radio'){
			var name = '单项选择';
		}else if(type=='checkbox'){
			var name = '多项选择';
		}else if(type=='selector'){
			var name = '普通选择';
		}else if(type=='time'){
			var name = '时间选择';
		}else if(type=='date'){
			var name = '日期选择';
		}else if(type=='region'){
			var name = '省市区选择';
		}else if(type=='switch'){
			var name = '开关选择';
		}else if(type=='upload'){
			var name = '上传图片';
		}
		var addhtml = '';
		addhtml += '<tr>'
		addhtml += '<td>'+name+'<input type="hidden" name="datatype['+ekey+']" value="'+type+'"/></td>'
		addhtml += '<td><input class="layui-input" type="text" style="width:120px" name="dataval1['+ekey+']" value="'+val1+'" placeholder="请输入字段名称"></td>'
		addhtml += '<td>'
		if(type=='input'){
			addhtml += '<input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+']" value="'+val2+'" placeholder="请输入提示信息">'
		}else if(type=='textarea'){
			addhtml += '<input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+']" value="'+val2+'" placeholder="请输入提示信息">'
		}else if(type=='radio' || type=='checkbox' || type=='selector'){
			if(val2){
				for(var i=0;i<val2.length;i++){
					addhtml += '<div><input class="layui-input" type="text" style="width:180px" name="dataval2['+ekey+'][]" value="'+val2[i]+'" placeholder="请输入选项名称">';
					if(i==0){
						addhtml += '<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addxuanxiang(this,'+ekey+')"><i class="fa fa-plus"></i></button></div>'
					}else{
						addhtml += '<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$(this).parent().remove()"><i class="fa fa-minus"></i></button></div>'
					}
				}
			}else{
				addhtml += '<div><input class="layui-input" type="text" style="width:180px" name="dataval2['+ekey+'][]" value="" placeholder="请输入选项名称">';
				addhtml += '<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="addxuanxiang(this,'+ekey+')"><i class="fa fa-plus"></i></button></div>'
			}
		}else if(type == 'time'){

			addhtml += '<div><input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+'][0]" value="'+(val2[0]?val2[0]:'00:00')+'" placeholder=\'开始时间，格式为"hh:mm"\'>';
			addhtml += '<div><input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+'][1]" value="'+(val2[1]?val2[1]:'23:59')+'" placeholder=\'结束时间，格式为"hh:mm"\'>';
		}else if(type == 'date'){
			addhtml += '<div><input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+'][0]" value="'+(val2[0]?val2[0]:'1970-01-01')+'" placeholder=\'开始日期，格式为"YYYY-MM-DD"\'>';
			addhtml += '<div><input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+'][1]" value="'+(val2[1]?val2[1]:'2080-01-01')+'" placeholder=\'结束日期，格式为"YYYY-MM-DD"\'>';
		}else if(type == 'region'){
			addhtml += '选择省市区';
		}else if(type == 'switch'){
			addhtml += '开启和关闭';
		}else if(type == 'upload'){
			addhtml += '<input class="layui-input" type="text" style="width:200px" name="dataval2['+ekey+']" value="'+val2+'" placeholder="请输入提示信息">'
		}
		addhtml += '</td>'
		//addhtml += '<td><select style="width:60px" name="dataval3['+ekey+']"><option value="1">是</option><option value="0" '+(val3==0?'selected="selected"':'')+'>否</option></select></td>'
		addhtml += '<td><input type="checkbox" name="dataval3['+ekey+']" value="1" lay-skin="switch" lay-text="开启|关闭" '+(val3==1?'checked':'')+'></td>'
		addhtml += '<td>'
		addhtml += '	<button title="删除" type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$(this).parent().parent().remove()"><i class="fa fa-remove"></i></button>'
		addhtml += '	<button title="上移" type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="toup(this)"><i class="fa fa-arrow-up"></i></button>'
		addhtml += '	<button title="下移" type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="todown(this)"><i class="fa fa-arrow-down"></i></button>'
		addhtml += '</td>'
		addhtml += '</tr>'
		// console.log(addhtml)
		$('#datatable').append(addhtml);
		layui.form.render('checkbox');
		ekey++;
	}
	//添加选项
	function addxuanxiang(obj,ekey){
		$(obj).parent().parent().append('<div><input class="layui-input" type="text" style="width:180px" name="dataval2['+ekey+'][]" value="" placeholder="请输入选项名称"><button type="button" class="layui-btn layui-btn-primary layui-btn-sm" onclick="$(this).parent().remove()"><i class="fa fa-minus"></i></button></div>');
	}
  </script>
	{include file="public/copyright"/}
</body>
</html>